//
//  UIBarButtonItem+Extension.swift
//  Weibo
//
//  Created by 杨雨哲 on 15/7/3.
//  Copyright © 2015年 yyz. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    convenience init(imageName:String, highlightedImageName:String?) {
        let btn = UIButton()
        btn.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        let highlightedName = highlightedImageName ?? imageName + "_highlighted"
        btn.setImage(UIImage(named: highlightedName), forState: UIControlState.Highlighted)
        btn.sizeToFit()
        self.init(customView: btn)
    }
}
